#ifndef CORE_STRINGUTILITY_H
#define CORE_STRINGUTILITY_H

inline string ReadFileToString(char* pShaderFilePath)
{
	ifstream in(pShaderFilePath);
	istreambuf_iterator<char> beg(in), end;
	string str(beg, end); 
	return str;
}

inline char* CreateString(char* pInput)
{
	char* pOutput = new char[strlen(pInput) + 1];
	memcpy(pOutput, pInput, strlen(pInput) + 1);
	return pOutput;
}

// BKDR Hash Function
inline unsigned int BKDRHash(char *str)
{
    unsigned int seed = 131; // 31 131 1313 13131 131313 etc..
    unsigned int hash = 0;
 
    while (*str)
    {
        hash = hash * seed + (*str++);
    }
 
    return (hash & 0x7FFFFFFF);
}

#endif